package com.heima.model.search.dtos;

import lombok.Data;

import java.util.Date;

/**
 * @author 谢金成
 * @date 2024/4/26 13:30
 */
@Data
public class UserSearchDto {

    private String searchWords;

    private int pageNum;

    private int pageSize;

    private Date minBehotTime;

    public int getFromIndex() {
        if (this.pageNum < 1) {
            return 0;
        }
        if (this.pageSize < 1) {
            this.pageSize = 10;
        }

        return this.pageSize * (this.pageNum - 1);
    }
}
